package simutanque;

import java.awt.Color;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;

/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
/**
 *
 * @author Augusto Wolf
 */
public class TelaTanque extends javax.swing.JFrame {

    /**
     * Creates new form jpTanque
     */
    public TelaTanque(String t) {
        this.tanque = t;
        initComponents();
        this.setTitle("SimuTanque - " + t);
        auto.start();
        jPanel2.setVisible(false);
    }
    String tanque;
    Thread auto = new Thread() {

        public void run() {
            while (true) {
                while (!jcbAutomatico.isSelected()) {
                    try {
                        Thread.sleep(100);
                    } catch (Exception ex) {
                    }
                }
                try {
                    int i = 100;
                    try {
                        i = Integer.parseInt(jftfAutomatico.getText());
                    } catch (Exception ex) {
                    }
                    if (i < 100) {
                        i = 100;
                        jftfAutomatico.setText("100");
                    }
                    Thread.sleep(i);
                } catch (Exception ex) {
                }
                atualizar();
            }
        }
    };

    public void atualizar() {
        Tanque tanque = Gerencia.obterInstancia().getTanque(this.tanque);
        //System.out.println((int) tanque.getVolumeMaximo());
        //System.out.println((int) tanque.getVolumeAtual());
        jProgressBar1.setMinimum(0);
        if (tanque.getVolumeMaximo() < 10000) {
            jProgressBar1.setMaximum((int) (tanque.getVolumeMaximo() * 100) - 1);
            jProgressBar1.setValue((int) (tanque.getVolumeAtual() * 100));
        } else {
            jProgressBar1.setMaximum((int) (tanque.getVolumeMaximo()) - 1);
            jProgressBar1.setValue((int) (tanque.getVolumeAtual()));
        }

        jcbTanques.removeAllItems();
        jcbTanques.addItem("-");
        Gerencia g = Gerencia.obterInstancia();
        int totalTanques = g.totalTanques();
        for (int i = 0; i < totalTanques; i++) {
            Tanque t = g.getTanque(i);
            jcbTanques.addItem(t.getNome());
        }

        double temp = tanque.getTemperaturaAtual();

        jftfVolumeMaximo.setText((tanque.getVolumeMaximo() + "").replaceAll("\\.", ","));
        jftfVolumeAtual.setText((tanque.getVolumeAtual() + "").replaceAll("\\.", ","));
        jftfPhDeSaida.setText((tanque.getPhAtual() + "").replaceAll("\\.", ","));
        jftfPhInicial.setText((tanque.getPhInicial() + "").replaceAll("\\.", ","));
        jftfPhDeEntrada.setText((tanque.getPhDeEntrada() + "").replaceAll("\\.", ","));
        jtfNome.setText(tanque.getNome());
        jftfAltura.setText((tanque.getAltura() + "").replaceAll("\\.", ","));
        jftfDiametroSaida.setText((tanque.getDiametroSaida() + "").replaceAll("\\.", ","));
        jftfLargura.setText((tanque.getLargura() + "").replaceAll("\\.", ","));
        jftfProfundidade.setText((tanque.getProfundidade() + "").replaceAll("\\.", ","));
        jftfTemperaturaDeEntrada.setText((tanque.getTemperaturaDeEntrada() + "").replaceAll("\\.", ","));
        temp = tanque.getTemperaturaDeEntrada();
        int red = (int) (temp * 255 / 100);
        int blue = 255 - (int) (temp * 255 / 100);
        // if(red>254)red=254;
        //  if(blue>254)blue=254;
        //   if(red<1)red=1;
        //   if(blue<1)blue=1;
        jftfTemperaturaDeEntrada.setBackground(new Color(red, 0, blue));
        jftfTemperaturaInicial.setText((tanque.getTemperaturaInicial() + "").replaceAll("\\.", ","));
        temp = tanque.getTemperaturaInicial();
        red = (int) (temp * 255 / 100);
        blue = 255 - (int) (temp * 255 / 100);
        //    if(red>254)red=254;
        //    if(blue>254)blue=254;
        //    if(red<1)red=1;
        //    if(blue<1)blue=1;
        jftfTemperaturaInicial.setBackground(new Color(red, 0, blue));


        jftfAmplitude.setText((tanque.getAmplitude() + "").replaceAll("\\.", ","));
        jftfPeriodo.setText((tanque.getPeriodo() + "").replaceAll("\\.", ","));
        jcbTipoFuncao.setSelectedIndex(tanque.getTipoFuncao());

        jftfVazaoEntrada.setText((tanque.getVazaoDeEntrada() + "").replaceAll("\\.", ","));
        jftfVolumeInicial.setText((tanque.getVolumeInicial() + "").replaceAll("\\.", ","));
        jftfVazaoDeSaida.setText((tanque.getVazaoDeSaida() + "").replaceAll("\\.", ","));
        temp = tanque.getTemperaturaAtual();
        red = (int) (temp * 255 / 100);
        blue = 255 - (int) (temp * 255 / 100);
        //   if(red>254)red=254;
        //   if(blue>254)blue=254;
        //   if(red<1)red=1;
        //   if(blue<1)blue=1;
        jftfTemperaturaDeSaida.setBackground(new Color(red, 0, blue));
        jftfTemperaturaDeSaida.setText((tanque.getTemperaturaAtual() + "").replaceAll("\\.", ","));
        //jftf.setText(tanque.());

        //System.out.println(red + " " + 0 + " " + blue);
        //jProgressBar1.setBackground(new Color(red, 0, blue));
        //jProgressBar1.setForeground(new Color(red, 0, blue));
        //jProgressBar1.

        try {
            jcbTanques.setSelectedIndex(Gerencia.obterInstancia().indexTanque(tanque.getAnterior().getNome()) + 1);
        } catch (Exception ex) {
        }

    }

    @Override
    public void setVisible(boolean visible) {
        super.setVisible(visible);
        if (visible) {
            atualizar();
        }
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jcbAutomatico = new javax.swing.JCheckBox();
        jButton1 = new javax.swing.JButton();
        jftfAutomatico = new javax.swing.JFormattedTextField();
        jProgressBar1 = new javax.swing.JProgressBar(javax.swing.JProgressBar.VERTICAL);
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jtfNome = new javax.swing.JTextField();
        jftfAltura = new javax.swing.JFormattedTextField();
        jftfLargura = new javax.swing.JFormattedTextField();
        jftfProfundidade = new javax.swing.JFormattedTextField();
        jftfVolumeInicial = new javax.swing.JFormattedTextField();
        jftfTemperaturaInicial = new javax.swing.JFormattedTextField();
        jftfVazaoEntrada = new javax.swing.JFormattedTextField();
        jftfTemperaturaDeEntrada = new javax.swing.JFormattedTextField();
        jcbTanques = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        jftfDiametroSaida = new javax.swing.JFormattedTextField();
        jLabel11 = new javax.swing.JLabel();
        jftfVolumeMaximo = new javax.swing.JFormattedTextField();
        jLabel12 = new javax.swing.JLabel();
        jftfVazaoDeSaida = new javax.swing.JFormattedTextField();
        jLabel13 = new javax.swing.JLabel();
        jftfTemperaturaDeSaida = new javax.swing.JFormattedTextField();
        jLabel14 = new javax.swing.JLabel();
        jftfVolumeAtual = new javax.swing.JFormattedTextField();
        jftfPhInicial = new javax.swing.JFormattedTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jftfPhDeSaida = new javax.swing.JFormattedTextField();
        jLabel17 = new javax.swing.JLabel();
        jftfPhDeEntrada = new javax.swing.JFormattedTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jftfAmplitude = new javax.swing.JFormattedTextField();
        jftfPeriodo = new javax.swing.JFormattedTextField();
        jcbTipoFuncao = new javax.swing.JComboBox();

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Atualização"));

        jcbAutomatico.setText("Atualização Automatica:");

        jButton1.setText("Atualizar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jftfAutomatico.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfAutomatico.setText("1000");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jcbAutomatico)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jftfAutomatico, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jcbAutomatico)
                    .addComponent(jButton1)
                    .addComponent(jftfAutomatico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("SimuTanque");
        setResizable(false);

        jProgressBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Propriedades"));

        jLabel1.setText("Nome:");

        jLabel2.setText("Largura:");

        jLabel3.setText("Profundidade:");

        jLabel4.setText("Altura:");

        jLabel5.setText("Volume Inicial:");

        jLabel6.setText("Temperatura Inicial:");

        jLabel7.setText("Tanque Anterior:");

        jLabel8.setText("Vazão de Entrada:");

        jLabel9.setText("Temperatura de Entrada:");

        jtfNome.setEditable(false);

        jftfAltura.setEditable(false);
        jftfAltura.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfAltura.setToolTipText("Definida em metros");

        jftfLargura.setEditable(false);
        jftfLargura.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfLargura.setToolTipText("Definida em metros");

        jftfProfundidade.setEditable(false);
        jftfProfundidade.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfProfundidade.setToolTipText("Definida em metros");

        jftfVolumeInicial.setEditable(false);
        jftfVolumeInicial.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfVolumeInicial.setToolTipText("Definido em litros");

        jftfTemperaturaInicial.setEditable(false);
        jftfTemperaturaInicial.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfTemperaturaInicial.setToolTipText("Definida em graus Celsius");

        jftfVazaoEntrada.setEditable(false);
        jftfVazaoEntrada.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfVazaoEntrada.setToolTipText("Definida em litros por segundo");

        jftfTemperaturaDeEntrada.setEditable(false);
        jftfTemperaturaDeEntrada.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfTemperaturaDeEntrada.setToolTipText("Definida em graus Celsius");

        jcbTanques.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-", "Tanque 1" }));
        jcbTanques.setEnabled(false);

        jLabel10.setText("Diametro de Saída");

        jftfDiametroSaida.setEditable(false);
        jftfDiametroSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfDiametroSaida.setToolTipText("Definido em litros");

        jLabel11.setText("Volume Máximo:");

        jftfVolumeMaximo.setEditable(false);
        jftfVolumeMaximo.setToolTipText("Definido em litros");

        jLabel12.setText("Vazão de Saída:");

        jftfVazaoDeSaida.setEditable(false);
        jftfVazaoDeSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfVazaoDeSaida.setToolTipText("Definida em litros por segundo");

        jLabel13.setText("Temperatura de Saída:");

        jftfTemperaturaDeSaida.setEditable(false);
        jftfTemperaturaDeSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfTemperaturaDeSaida.setToolTipText("Definida em graus Celsius");

        jLabel14.setText("Volume Atual:");

        jftfVolumeAtual.setEditable(false);
        jftfVolumeAtual.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfVolumeAtual.setToolTipText("Definido em litros");

        jftfPhInicial.setEditable(false);
        jftfPhInicial.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfPhInicial.setToolTipText("Varia de 0 à 14");

        jLabel15.setText("PH Inicial:");

        jLabel16.setText("PH de Saída:");

        jftfPhDeSaida.setEditable(false);
        jftfPhDeSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfPhDeSaida.setToolTipText("Varia de 0 à 14");

        jLabel17.setText("PH de Entrada");

        jftfPhDeEntrada.setEditable(false);
        jftfPhDeEntrada.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfPhDeEntrada.setToolTipText("Varia de 0 à 14");

        jLabel18.setText("Amplitude:");

        jLabel19.setText("Período:");

        jLabel20.setText("Tipo Função:");

        jftfAmplitude.setEditable(false);
        jftfAmplitude.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfAmplitude.setToolTipText("Definida em litros por segundo");

        jftfPeriodo.setEditable(false);
        jftfPeriodo.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter()));
        jftfPeriodo.setToolTipText("Definida em milesegundos");

        jcbTipoFuncao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Linear", "Senoidal", "Quadrática", "| Senoidal |", "Triangular", "-" }));
        jcbTipoFuncao.setSelectedIndex(5);
        jcbTipoFuncao.setEnabled(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel20)
                    .addComponent(jLabel19)
                    .addComponent(jLabel18)
                    .addComponent(jLabel17)
                    .addComponent(jLabel14)
                    .addComponent(jLabel13)
                    .addComponent(jLabel11)
                    .addComponent(jLabel10)
                    .addComponent(jLabel9)
                    .addComponent(jLabel8)
                    .addComponent(jLabel7)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2)
                    .addComponent(jLabel12)
                    .addComponent(jLabel15)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jftfPhDeSaida)
                    .addComponent(jftfPhInicial)
                    .addComponent(jtfNome)
                    .addComponent(jftfAltura)
                    .addComponent(jftfLargura, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfProfundidade, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfVolumeInicial)
                    .addComponent(jftfTemperaturaInicial, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfVazaoEntrada, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfTemperaturaDeEntrada, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jcbTanques, 0, 161, Short.MAX_VALUE)
                    .addComponent(jftfDiametroSaida, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfVolumeMaximo)
                    .addComponent(jftfVazaoDeSaida, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfTemperaturaDeSaida, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfVolumeAtual, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfPhDeEntrada, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfAmplitude, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jftfPeriodo, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jcbTipoFuncao, 0, 161, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jtfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jftfLargura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jftfProfundidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jftfAltura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jftfDiametroSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jftfVolumeMaximo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jftfVolumeInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jftfTemperaturaInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jftfPhInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jcbTanques, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jftfAmplitude, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(jftfPeriodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jcbTipoFuncao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jftfVazaoEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jftfTemperaturaDeEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jftfPhDeEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jftfVolumeAtual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jftfVazaoDeSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jftfTemperaturaDeSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(jftfPhDeSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        atualizar();
    }//GEN-LAST:event_jButton1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JCheckBox jcbAutomatico;
    private javax.swing.JComboBox jcbTanques;
    private javax.swing.JComboBox jcbTipoFuncao;
    private javax.swing.JFormattedTextField jftfAltura;
    private javax.swing.JFormattedTextField jftfAmplitude;
    private javax.swing.JFormattedTextField jftfAutomatico;
    private javax.swing.JFormattedTextField jftfDiametroSaida;
    private javax.swing.JFormattedTextField jftfLargura;
    private javax.swing.JFormattedTextField jftfPeriodo;
    private javax.swing.JFormattedTextField jftfPhDeEntrada;
    private javax.swing.JFormattedTextField jftfPhDeSaida;
    private javax.swing.JFormattedTextField jftfPhInicial;
    private javax.swing.JFormattedTextField jftfProfundidade;
    private javax.swing.JFormattedTextField jftfTemperaturaDeEntrada;
    private javax.swing.JFormattedTextField jftfTemperaturaDeSaida;
    private javax.swing.JFormattedTextField jftfTemperaturaInicial;
    private javax.swing.JFormattedTextField jftfVazaoDeSaida;
    private javax.swing.JFormattedTextField jftfVazaoEntrada;
    private javax.swing.JFormattedTextField jftfVolumeAtual;
    private javax.swing.JFormattedTextField jftfVolumeInicial;
    private javax.swing.JFormattedTextField jftfVolumeMaximo;
    private javax.swing.JTextField jtfNome;
    // End of variables declaration//GEN-END:variables
}
